﻿using System.Windows.Forms;
using DepSoft.Helpers.iTunes.Elements;
using PH.DataTree;

namespace DepSoft.Gui.iExporter
{
    public class iTunesPlayListMapper : ITreeNodeMapper
    {
        #region ITreeNodeMapper Members

        public object GetNodeInfo(TreeNode treeNode)
        {
            return treeNode.Tag;
        }

        public void UpdateNode(object dataNode, TreeNode treeNode)
        {
            treeNode.Text = ((DTreeNode<iTunesPlaylist>)dataNode).Value.Name;
            treeNode.Name = ((DTreeNode<iTunesPlaylist>)dataNode).Value.Id;
            treeNode.Tag = ((DTreeNode<iTunesPlaylist>)dataNode).Value;
        }

        #endregion
    }
}
